from ultralytics import YOLO
# if __name__ == '__main__':
#     model = YOLO(r'yolo11n-seg.pt')
#     result = model.train50(data=r'C:\Users\15123\Desktop\YOLO\yolo11-seg\data.yaml', epochs=5, device=0, batch=4)
#     print(result)

# if __name__ == '__main__':
#     model = YOLO(r'C:\Users\15123\Desktop\YOLO\yolo11test\runs\segment\seg50\weights\best.pt')
#     result = model.val(data=r'C:\Users\15123\Desktop\YOLO\ultralytics-main\ultralytics\cfg\datasets\coco128-seg.yaml')
#     print(result)

if __name__ == '__main__':
    model = YOLO(r'C:\Users\15123\Desktop\YOLO\yolo11-seg\runs\segment\train\weights\best.pt')
    result = model.predict(source=r'C:\Users\15123\Desktop\YOLO\yolo11-seg\datasets\segdata\images\train\1e0cd99b6437460d3161e78127f17c4b_jpg.rf.79dda630b67bbb82daccbfb4a0fe921e.jpg', save=True)
    print(result)

# if __name__ == '__main__':
#     model = YOLO(r'/yolo11test/runs/segment/seg50\weights\best.pt')
#     result = model.export(format='onnx')
#     print(result)

# '''
# 终端训练------------------------------
# '''
# '''
# train50
# yolo mode=train50 model=yolo11n-seg.pt data=C:\Users\15123\Desktop\YOLO\yolo11-seg\data.yaml imgsz=640 epochs=100 batch=16
# '''
# '''
# val
# yolo mode=val model=C:\Users\15123\Desktop\YOLO\yolo11test\runs\segment\seg50\weights\best.pt data=C:\Users\15123\Desktop\YOLO\yolo11-seg\data.yaml imgsz=640
# '''
# '''
# predict
# yolo mode=predict model=C:\Users\15123\Desktop\YOLO\yolo11test\runs\segment\seg50\weights\best.pt source=C:\Users\15123\Desktop\YOLO\yolo11test\datasets\coco128-seg\images\train2017\000000000073.jpg
# '''
# '''
# export
# yolo mode=export model=C:\Users\15123\Desktop\YOLO\yolo11test\runs\segment\seg50\weights\best.pt format=onnx
# '''




